<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class RenewRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'year'     => 'integer|min:0',
            'saler_id' => 'integer|min:1',
            'amount'   => 'required'
        ];
    }

    public function messages()
    {
        return [
            'year.min'     => '请选择续费年限',
            'saler_id.min' => '请选择业务人员',
            'amount.required'       => '请填写续费金额'
        ];
    }
}
